package com.myproject.shop.controller;


import com.myproject.shop.util.AjaxResult;
import com.myproject.shop.util.BizException;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "异常测试例子0825王慧敏")

@RestController
@RequestMapping("/api/exception")
public class ExceptionController {

    @ApiOperation("全局业务异常测试")
    @GetMapping("/test")
    public AjaxResult exception() {
        throw new BizException(404, "没找到");
    }
}